package com.sunwayworld.basemodule.rm.client.resource.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.sunwayworld.basemodule.rm.client.resource.LimsClientResource;
import com.sunwayworld.basemodule.rm.client.service.LimsClientService;
import com.sunwayworld.framework.spring.annotation.GikamBean;
import com.sunwayworld.framework.log.annotation.Log;
import com.sunwayworld.framework.log.annotation.LogModule;
import com.sunwayworld.framework.log.annotation.LogType;
import com.sunwayworld.framework.restful.data.RestJsonWrapperBean;

@LogModule("送检客户")
@RestController
@GikamBean
public class LimsClientResourceImpl implements LimsClientResource {

    @Autowired
    private LimsClientService limsClientService;

    @Override
    public LimsClientService getService() {
        return limsClientService;
    }

    @Log(value = "新增送检客户", type = LogType.INSERT)
    @Override
    @RequestMapping(method = RequestMethod.POST)
    public Long insert(RestJsonWrapperBean wrapper) {
        return getService().insert(wrapper);
    }

    @Override
    public void enableClient(RestJsonWrapperBean wrapper) {
        getService().enableClient(wrapper);
    }

    @Override
    public void disableClient(RestJsonWrapperBean wrapper) {
        getService().disableClient(wrapper);
    }

    @Log(value = "选择人员", type = LogType.UPDATE)
    @Override
    public void updatePersons(RestJsonWrapperBean wrapper) {
        getService().updatePersons(wrapper);
    }
}
